@extends('Admin.common.header') 
<br/><br/><br/><br/>

<!-- 页面标记 -->
<div style="float:left;margin-left:130px;">
	<mark style="font-size:18px;">分类列表</mark>
</div>


<!-- 搜索框 -->
<form action="{{ url('/category/index') }}" method='post' >
	<div class="col-lg-6" style="width:35%;float:left;margin-left:200px;" >
		<div class="input-group"  >
			
			{{ csrf_field() }}
			
			<input  type="text" name='keyword' class="form-control" placeholder="输入分类名 进行查询 ...." value="{{ $request or '' }}" />
			
			<span class="input-group-btn">
				<input class="btn btn-default" type="submit" value="Go!" />
				<a class="btn btn-default" href="{{ url('/category/index') }}" />清空条件</a>
			</span>
			
		</div>
	</div>
</form>

<br/><br/><br/>

<!-- 分类表格 -->
<div class="bs-example" data-example-id="hoverable-table" style="width:70%;margin:0 auto;">
    <table class="table table-hover">
		<thead>
			<tr>
			  <th>id</th>
			  <th>分类名</th>
			  <th>路径</th>
			  <th>创建时间</th>
			  <th>操作</th>
			</tr>
		</thead>
		<tbody>
			@forelse($category as $key=> $category_info)
				<tr>
					<th scope="row">{{ $category_info->id }}</th>
					@if ( isset($blank[$key]) )
					<td>
						{{ $blank[$key] }}{{ $category_info->name }}
					</td>
					@else
					<td>
						{{ $category_info->name }}
					</td>
					@endif
					
					<td>{{ $category_info->path }}</td>
					<td>{{ $category_info->create_time }}</td>
					<td>
						<a href="{{ url('/category/create') }}/{{ $category_info->id }}">		编辑
						</a>
					</td>
				</tr>
			@empty
				<tr>
					<td scope="row"><h2>暂无数据</h2></td>
				</tr>
			@endforelse
		</tbody>
    </table>
</div>

<!-- 分页 -->
<div style='text-align:center;'>
	{{ $category->appends(['keyword'=>$request])->links() }}
</div>
<div class="badge" style="width:100%;text-align:center;font-size:18px;margin-bottom:70px;" >
		共{{ $category->total() }}条数据
</div>


@extends('Admin.common.footer')